Repository navigation
Send a run's tools, context and catalog once, then by their hashes - #2823
Merged
Merged
Conversation
Every run and every join of a conversation the web app sent carried the same tools, context and generative UI catalog: 146 KB for a Bot holding every component and its computer, on every message and every step of a turn. Where the server answers runPartsByReference, the first request of a page now carries each part with its hash, and every request after it the hashes alone: about 1 KB. It is done on the agent's own fetch, not on the run, because the SDK checks a run against AG-UI's schema as it sends it and the by-reference form is deliberately not one AG-UI takes. So everything on the page, and every Bot the server hands the run to, still sees the run whole. A part the server no longer holds (409 RUN_PARTS_NEEDED) sends the request again once with every part; any other 409 goes back to the SDK as before. A server that refuses the form (400, an older one behind a newer answer) gets that request and every later one whole. A server that doesn't say it takes the form gets every request whole, as today.
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
December 2, 2026 23:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Every run the web app sent, and every join of a conversation, carried the same tools, context and generative UI catalog. For a Bot holding every component and its computer that is 146 KB, on every message and every step of a turn. Where the server answers
runPartsByReference(#2819), the first request of a page now carries each part with its hash, and every request after it carries the hashes alone.Measured with the real app, through its own CopilotKit provider and every tool and component it registers:
How it works:
fetch. Thatfetchis wrapped however often the SDK sets it, because the SDK resets it whenever it registers the agent again. This covers both run paths: events back on the request, and events over the realtime socket.RUN_PARTS_NEEDED) sends the request again once, carrying every part. Any other 409, such as a conversation that is already answering, goes back to the SDK unchanged.Where it runs
In the browser:
app/src/lib/copilot/run-parts.ts, given to each agent beside its offer inbot-offer.ts. The server puts the parts back withfillRunPartsfromshared/run-parts.ts(#2819).API and database
No API change here; it reads
deployment.runPartsByReference. No database change.Changelog
Web app and OpenBot Desktop.
Proof
app/tests/run-parts-sent.test.tsxruns the real app against a server that fills the parts back withfillRunParts(the server's own code):Red before the fix: with
sendPartsByReferencenot given, the first test fails (the run after the first is 146 KB). The whole app suite passes.